package com.diandian.backend.entrance.dto;

import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;

public class GetProductSkuInfoReqDTO implements Serializable {

    private String offlineStoreCode; // 线下门店编码
    private String onlineStoreCode; // 线上门店编码：有线上编码优先使用线上编码，否则使用线下门店编码兑换线上编码
    private String productCode; // 商品编码
    private String skuCode; // sku编码

    public boolean check(){
        if((offlineStoreCode == null || "".equals(offlineStoreCode)) && (onlineStoreCode == null || "".equals(onlineStoreCode))){
            throw new DefaultException("门店编码不能为空");
        }
        if(productCode == null || "".equals(productCode)){
            throw new DefaultException("商品编码不能为空");
        }
        if(skuCode == null || "".equals(skuCode)){
            throw new DefaultException("SKU编码不能为空");
        }
        return true;
    }

    public String getOfflineStoreCode() {
        return offlineStoreCode;
    }

    public void setOfflineStoreCode(String offlineStoreCode) {
        this.offlineStoreCode = offlineStoreCode;
    }

    public String getOnlineStoreCode() {
        return onlineStoreCode;
    }

    public void setOnlineStoreCode(String onlineStoreCode) {
        this.onlineStoreCode = onlineStoreCode;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }
}
